var t = require("../../../../../@babel/runtime/helpers/toConsumableArray"), e = getApp();

Component({
    properties: {
        goodsInfo: {
            type: null,
            observer: function(t) {
                if (this.setData({
                    goodsInfo: t
                }), t.get_comment) {
                    var e = t.get_comment;
                    this.setData({
                        commentLimit: e.data ? e.data.slice(0, 5) : [],
                        is_show_default_praise: e.is_show_good_reputation_text
                    });
                }
            }
        },
        goodsId: {
            type: null
        },
        commentPage: {
            type: null
        },
        comment_name: {
            type: null,
            value: "精选口碑"
        },
        goods_type: {
            type: null
        }
    },
    data: {
        commentLimit: [],
        streetShow: !1,
        is_show_default_praise: 0
    },
    lifetimes: {
        attached: function(t) {}
    },
    methods: {
        goKb: function() {
            console.log(this.data.goodsInfo), wx.navigateTo({
                url: "/packageA/others/GoodsComment/GoodsComment?gid=" + this.data.goodsId + "&istype=comment" + "&comment_name=".concat("course" == this.data.goods_type ? "课程评论" : "")
            });
        },
        toContentInfo: function(t) {
            var e = t.currentTarget.dataset.jsondata;
            wx.navigateTo({
                url: "/packageD/member/CommentDetails/CommentDetails?order_id=" + e.order_id + "&goods_id=" + e.goods_id + "&uid=" + e.uid + "&comment_id=" + e.id
            });
        },
        seePicture: function(t) {
            var e = t.currentTarget.dataset.pics, o = t.currentTarget.dataset.index;
            wx.previewImage({
                current: e[o],
                urls: e
            });
        },
        streetClose: function() {
            this.setData({
                streetShow: !1
            });
        },
        getCommentData: function() {
            var o = this, a = e.getNetAddresss("goods.comment.get-comment");
            a += "&goods_id=" + this.data.goodsId, a += "&page=" + this.data.commentPage, e._getNetWork({
                showToastIn: !1,
                url: a,
                success: function(a) {
                    var n = a.data;
                    1 == n.result ? (n.data.data.length < 20 && o.setData({
                        noMoreComment: !0
                    }), o.setData({
                        commentPage: o.data.commentPage + 1
                    }), o.data.third_content || o.setData({
                        third_content: []
                    }), o.setData({
                        third_content: [].concat(t(o.data.third_content), t(n.data.data)),
                        streetShow: !0
                    }), e._isTextEmpty(o.data.third_content) ? o.setData({
                        thirKong: !1
                    }) : o.setData({
                        thirKong: !0
                    })) : o.setData({
                        is_third_content: !1
                    });
                },
                fail: function(t) {
                    o.setData({
                        is_third_content: !1
                    }), console.log(t);
                }
            });
        }
    }
});